<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommonCargosTable extends Migration
{
    /**
     * 常发货源表
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('common_cargos', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->unsignedInteger('user_id')->index('user_id')->comment('货主id');
            $table->string('addr')->comment('地址');
            $table->string('name', 32)->comment('联系人');
            $table->string('phone', 11)->comment('电话');

            $table->charset = 'utf8';
            $table->collation = 'utf8_unicode_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('common_cargos');
    }
}
